<template>
  <view class="page bg-white padding">
	  <fu-custom bgColor="bg-white" :isBack="true" :isBottom="true">
	    <block slot="content">{{i18n['消息详情']}}</block>
	  </fu-custom>
    <!-- 页面加载 start -->
    <fu-loading v-if="isShowLoading"></fu-loading>
    <!-- 页面加载 end -->
    <block v-else>
      <!-- 文章标题 start -->
      <view class="text-lg text-bold text-333">{{ detail.title }}</view>
      <view class="text-sm text-999 margin-top-16">{{ detail.add_time }}</view>
      <!-- 文章标题 end -->

      <!-- 文章详情 start -->
      <view class="margin-top text-666 text-df">
        <jyf-parser :html="body"></jyf-parser>
      </view>
      <!-- 文章详情 end -->
    </block>

    <!-- 网络检测 start -->
    <fu-notwork></fu-notwork>
    <!-- 网络检测 end -->
  </view>
</template>

<script>
import richText from "@/common/utils/richText.js";
export default {
  data() {
    return {
      isShowLoading: false, //页面加载loading

      id: "",
      detail: "",
      content: "",
      body: "",
    };
  },
  onLoad(options) {
    this.id = options.id;
  },
  onShow() {
    this.getData();
  },
  methods: {
    getData() {
      var self = this;
      this.$api
        .post(global.apiUrls.postOperationGetArticleDetail, {
          id: this.id,
        })
        .then((res) => {
          self.detail = res.data.data;
          self.body = richText.format(res.data.data.body);
          self.isCollect = res.data.data.is_collection;
          uni.hideLoading();
        });
    },
  },
};
</script>

<style lang="scss">
.page {
  height: 100%;
}


</style>
